<template>
  <div>
    <div>
      <x-header
        :left-options="{ backText: '', showBack: false }"
        @on-click-more="showMenusOfPersonalInfo = true"
        >编辑{{ locationTitle }}</x-header
      >
    </div>
    <div v-show="showCreateTagPage">
      <createTagPage></createTagPage>
    </div>
    <div v-show="showCreateTodoPage">
      <createTodoPage></createTodoPage>
    </div>
  </div>
</template>
<script>
import createTagPage from "views-new/students/schedule/utilPages/createTagPage";
import createTodoPage from "views-new/students/schedule/utilPages/createTodoPage";
import { XHeader, Tab, TabItem } from "vux";

export default {
  name: "S_collection_of_creation",
  data() {
    return {
      showCreateTagPage: false,
      showCreateTodoPage: false,
      locationTitle: "", //顶部标题栏显示的文字
    };
  },
  components: {
    XHeader,
    Tab,
    TabItem,
    createTagPage,
    createTodoPage,
  },
  mounted() {
    this.createTodo();
    this.location();
  },
  methods: {
    back() {
      this.$router.replace("/S_mainview");
    },
    location() {
      const tagFlag = this.$store.state.isTag;
      const scheduleFlag = this.$store.state.isSchedule;
      console.log("tagFlag", tagFlag);
      console.log("scheduleFlag", scheduleFlag);
      if (tagFlag) {
        this.createTag();
      } else {
        this.createTodo();
      }
    },
    createTag() {
      this.locationTitle = "标签";
      console.log("新建标签");
      this.showCreateTagPage = true;
      this.showCreateTodoPage = false;
    },
    createTodo() {
      this.locationTitle = "日程";
      console.log("新建日程");
      this.showCreateTagPage = false;
      this.showCreateTodoPage = true;
    },
  },
};
</script>
